package com.xingfly.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.List;

/**
 * 用户Post blog 动态 等。。
 * Created by SuperS on 2016/12/7.
 */
@Entity
@Table(name = "xf_post")
public class Post extends BaseModel {

    @OneToOne
    @JoinColumn(name = "author_id")
    private User author;

    private String content;

    private String title;

    private String excerpt;
    //状态 公开 隐私 保存 编辑
    @JsonIgnore
    private Integer postStatus;
    //是否允许评论
    @JsonIgnore
    private Integer commentStatus;

    private int likeCount;

    private int commentCount;

    private int shareCount;

    private int postAlbum;

    @ManyToMany
//    @ElementCollection
    @Column(name = "tags")
    private List<Tag> tags;


    public User getAuthor() {
        return author;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getExcerpt() {
        return excerpt;
    }

    public void setExcerpt(String excerpt) {
        this.excerpt = excerpt;
    }

    public int getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(int likeCount) {
        this.likeCount = likeCount;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public int getPostAlbum() {
        return postAlbum;
    }

    public void setPostAlbum(int postAlbum) {
        this.postAlbum = postAlbum;
    }

    public int getShareCount() {
        return shareCount;
    }

    public void setShareCount(int shareCount) {
        this.shareCount = shareCount;
    }

    public Integer getPostStatus() {
        return postStatus;
    }

    public void setPostStatus(Integer postStatus) {
        this.postStatus = postStatus;
    }

    public Integer getCommentStatus() {
        return commentStatus;
    }

    public void setCommentStatus(Integer commentStatus) {
        this.commentStatus = this.commentStatus;
    }

    public void setCommentStatus(int commentStatus) {
        this.commentStatus = commentStatus;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }


}
